Back to Poly

Autokey Cipher

What is an Autokey Cipher?

Autokey cipher is a polyalphabetic substitution cipher similar to the Vigenère cipher, but instead of repeating the keyword, it uses the plaintext itself as part of the key. This makes it more secure than Vigenère because the key stream doesn't repeat in a predictable pattern

Autokey

Key Components:

   1. Initial keyword
   2. Plaintext message
   3. Key stream (keyword + plaintext)
   4. Use: E(x) = (x + k) mod 26 for Encryption
   5. Use: D(x) = (x - k) mod 26 for Decryption

Key Rules:

   • Start with a keyword
   • Append plaintext to keyword for key stream
   • Use the En/De formula
   • Skip spaces and punctuation

Example:

Keyword: "CROWN"
Message: "HELLO WORLD"
   1. Remove spaces: "HELLOWORLD"
   2. Create key stream:
      • CROWN (keyword)
      • HELLO (first 5 letters of plaintext)
      • Key stream: CROWNHELLO
   3. Encryption:
      • Message: HELLOWORLD
      • Keystream: CROWNHELLO
      • Result: JRYZSKVZWK

Calculation:
   • H + C = J
   • E + R = R
   • L + O = Y
   • L + W = Z
   • O + N = S   And so on...

Decryption:

   • Use keyword to decrypt first few letters
   • Use recovered plaintext to continue decryption
   • Work progressively through message

Video for explanation